<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"
    import="com.bean.*,java.util.*,com.utils.*"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<title>在此处插入标题</title>
</head>
<body>
<jsp:include page="student_head.jsp"></jsp:include>
<%
	StringBuffer sb = new StringBuffer();
	//查询所有考试信息
	List<Exam> list = DaoFactory.getExamDaoInstance().allexamsearch();
	for (Exam exam : list) {
		sb.append("<tr><td>");
		sb.append(exam.getE_name());
		sb.append("</td><td>");
		sb.append(exam.getE_starttime());
		sb.append("</td><td>");
		sb.append(exam.getE_teacher());
		sb.append("</td><td>");
		if (exam.getE_examination() == null){
			sb.append("");
		}
		else{
			sb.append("<span class='glyphicon glyphicon-ok'></span>");
		}
		sb.append("</td><td>");
		if (exam.getE_isstart()) {
			sb.append("<a href='student_main.jsp" + "' title='参加考试' class='btn btn-primary btn-sm'>参加考试</a>");
		} 
		else{
			sb.append("<span>考试已结束</span>");
		}
		sb.append("</td></tr>");
	}
%>
<%
	String StudentPwd_message = (String) session.getAttribute("StudentPwd_message");
	out.print(StudentPwd_message);
	session.setAttribute("StudentPwd_message", "");
%>
<div class="container">
	<div class="panel panel-info">
	<div class="panel-heading">
		<h3 class="panel-title">
			<span class="glyphicon glyphicon-th-list"></span>所有考试
        </h3>
    </div>
    <div class="panel-body">
        <table class="table table-bordered">
            <tr>
              <th class="col-md-2">考试名称</th>
              <th class="col-md-5">考试时间</th>
              <th class="col-md-1">创建人</th>
              <th class="col-md-2">上传试卷</th>
              <th class="col-md-2">操作</th>
            </tr>
	        <%=sb.toString()%>
        </table>
    </div>
    </div>
</div>
</body>
</html>